# Once done, this will define
#
#  HV_INCLUDE_DIR - the hv include directory
#  HV_LIBRARY_DIR - the hv library directory
#  HV_LIBS - link these to use hv
#
#  ......

MACRO(LOAD_LIBHV os arch)
    #MESSAGE(INFO "--------------------------------")
    #MESSAGE(STATUS "3RDPARTY_DIR: ${3RDPARTY_DIR}")
    #FIND_FILE(SPDLOG_INCLUDE_DIR include ${3RDPARTY_DIR} NO_DEFAULT_PATH)
    #FIND_FILE(SPDLOG_LIBRARY_DIR lib ${3RDPARTY_DIR} NO_DEFAULT_PATH)
    IF(DEFINED SERVER_3RDPARTY_PATH)
        SET(3RDPARTY_DIR ${SERVER_3RDPARTY_PATH}/libhv)
        SET(HV_INCLUDE_DIR ${3RDPARTY_DIR}/include)
        SET(HV_LIBRARY_DIR ${3RDPARTY_DIR}/lib)
    ELSE()
        SET(3RDPARTY_DIR ${PROJECT_SOURCE_DIR}/3rdparty/target)
        SET(HV_INCLUDE_DIR ${3RDPARTY_DIR}/include/hb)
        SET(HV_LIBRARY_DIR ${3RDPARTY_DIR}/lib/${${os}}_${${arch}}/hb)
    ENDIF()

    IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
        SET(HV_LIBS hv)
    ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
        SET(HV_LIBS hv ssl crypto)
    ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")
ENDMACRO()